import {Component, ElementRef, OnInit} from '@angular/core';
import {AppContextService} from '../../shared/services/app-context.service';
import {ConfirmationService} from 'primeng/api';
import {Func} from '../../shared/model/share.model';
import {MarkdownService} from 'angular2-markdown';
import {Lightbox} from 'angular2-lightbox';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css'],

})
export class HomeComponent implements OnInit {
  demo_ts = require('!!raw-loader!./home.component.ts');
  blockedPanel: boolean;
  aa= ['11', '22'];
  constructor(
    private app: AppContextService,
    public confirmService: ConfirmationService,
    private _markdown: MarkdownService,
  ) {
  }

  ngOnInit() {
    this._markdown.renderer.blockquote = (quote: string) => {
      return `<blockquote class="king-quote">${quote}</blockquote>`;
    };
  }

  // showConfirm() {
  //   this.app.confirm({
  //     title: '222',
  //     msg: 'ddee'
  //   });
  // }

  showConfirm(sender: any) {
    console.dir(sender);
     sender.style.color = 'red';
     sender.innerHTML = '<span class="ui-button-text ui-clickable">Block</span>';
     sender.disable = true;

      // this.app.confirm({
      //   title: '222',
      //   msg: 'ddee'
      // });

    // this.confirmService.confirm({
    //   message: 'Are you sure that you want to proceed?',
    //   header: 'Confirmation',
    //   icon: 'fa fa-question-circle',
    //   accept: () => {
    //     // this.msgs = [{severity:'info', summary:'Confirmed', detail:'You have accepted'}];
    //   },
    //   reject: () => {
    //     // this.msgs = [{severity:'info', summary:'Rejected', detail:'You have rejected'}];
    //   }
    // });
  }

}
